package com.zx.notification.consumer.config;

import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

/**
 * RocketMQ消费者配置类
 * 用于读取和管理RocketMQ消费者相关的配置参数
 */
@RefreshScope // 支持Nacos的动态刷新功能
@Configuration
@Getter
public class RocketMqConsumerConfig {
    /**
     * rocketmq是否启用，控制是否启用rocketmq消息队列功能
     */
    @Value("${spring.rocketmq.enabled:true}")
    private boolean rocketmqEnabled;

    /**
     * RocketMQ NameServer地址，用于连接RocketMQ的NameServer服务
     */
    @Value("${spring.rocketmq.name-server}")
    private String nameServer;

    // Consumer配置
    /**
     * RocketMQ消费者组，用于标识消费者属于哪个消费者组
     */
    @Value("${spring.rocketmq.consumer.group}")
    private String consumerGroup;

    /**
     * RocketMQ消费者最小线程数，控制消费者处理消息的最小线程数量
     */
    @Value("${spring.rocketmq.consumer.consume-thread-min}")
    private int consumerConsumeThreadMin;

    /**
     * RocketMQ消费者最大线程数，控制消费者处理消息的最大线程数量
     */
    @Value("${spring.rocketmq.consumer.consume-thread-max}")
    private int consumerConsumeThreadMax;
}